<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::group(['namespace' => 'Api\Third', 'prefix' => 'api/third'], function () {
    Route::any('wechat', 'WechatController@index');
    Route::get('wechat/receipt', 'WechatController@receipt');
    Route::get('wechat/payment', 'WechatController@payment');
    Route::get('wechat/prepare', 'WechatController@prepare');
    Route::post('wechat/notify/{type?}', 'WechatController@notify');
    Route::get('wechat/menu', 'WechatController@menu');
    Route::post('wechat/share', 'WechatController@share');
});

Route::get('admin_1427a/logs', 'Admin\HomeController@index');
Route::get('admin_1427a/user', 'Admin\HomeController@user');
Route::get('admin_1427a/user_list', 'Admin\HomeController@user_list');
Route::get('admin_1427a/user_all', 'Admin\HomeController@userAll');
Route::post('admin_1427a/user_vip_cancel', 'Admin\HomeController@user_vip_cancel');
Route::get('admin_1427a/user/log', 'Admin\UserController@log');
Route::get('admin_1427a/hldy', 'Admin\HomeController@hldy');
Route::get('admin_1427a/vip', 'Admin\HomeController@vip');
Route::get('admin_1427a/fish', 'Admin\HomeController@fish');
Route::any('admin_1427a/cq', 'Admin\HomeController@cq');
Route::get('admin_1427a/sgdzz', 'Admin\HomeController@sgdzz');
Route::get('admin_1427a/sgdzz_total', 'Admin\HomeController@sgdzz_total');
Route::get('admin_1427a/jyb', 'Admin\HomeController@jyb');

Route::get('admin_1427a/mall/goods', 'Admin\MallController@goods');
Route::get('admin_1427a/mall/order', 'Admin\MallController@order');
Route::get('admin_1427a/mall/edit', 'Admin\MallController@edit');
Route::post('admin_1427a/mall/save', 'Admin\MallController@save');

//卡卷
Route::get('admin_1427a/coupon', 'Admin\CouponController@index');
Route::get('admin_1427a/coupon/edit', 'Admin\CouponController@edit');
Route::post('admin_1427a/coupon/save', 'Admin\CouponController@save');

Route::group(['namespace' => 'Third', 'prefix' => 'third'], function () {
    Route::post('wechat/auth-receipt', 'WechatController@auth_receipt');
    Route::get('wechat/callback-receipt', 'WechatController@callback_receipt');
    Route::post('wechat/auth-payment', 'WechatController@auth_payment');
    Route::get('wechat/callback-payment', 'WechatController@callback_payment');
});

Route::group(['middleware' => ['wechat.oauth', 'auth']], function () {

    Route::group(['namespace' => 'Api', 'prefix' => 'api'], function () {
        Route::get('user/qrcode', 'UserController@qrcode');
        Route::get('user/qrcode_list', 'UserController@qrcode_list');
        Route::get('user/center', 'UserController@center_api');
        Route::post('user/sendcode', 'UserController@sendcode');
        Route::post('user/checkcode', 'UserController@checkcode');
        Route::get('user/fan', 'UserController@fan');


        Route::get('rank/gamewin', 'RankController@gamewin');

//        Route::group(['namespace' => 'Zghpt', 'prefix' => 'zghpt'], function() {
//       	    Route::get('hb/index', 'HbController@index');
//       	    Route::any('hb/create', 'HbController@create');
//            Route::any('hb/unlock', 'HbController@unlock');
//       	    Route::any('hb/fans', 'HbController@fans');
//            Route::get('hb/gamereward', 'HbController@gameReward');
//        });

        //红包
        Route::group(['namespace' => 'Coupon', 'prefix' => 'coupon'], function() {
            Route::get('userCoupon', 'CouponController@userCoupon');
            Route::get('goodsCoupon', 'CouponController@goodsCoupon');
            Route::post('giveCoupon', 'CouponController@giveCouponUser');

        });

        //欢乐钓鱼
        Route::group(['namespace' => 'Hldy', 'prefix' => 'hldy'], function() {
            Route::get('dy/index', 'DyController@index');
            Route::post('dy/doFish', 'FishingController@doFish');
        });

        //水果大作战
        Route::group(['namespace' => 'Sgdzz', 'prefix' => 'sgdzz'], function() {
            Route::get('getRunningIssue', 'SgdzzController@getRunningIssue');
            Route::get('getLatestWinInfo', 'SgdzzController@getLatestWinInfo');
            Route::get('getLatestWinDetail', 'SgdzzController@getLatestWinDetail');
            Route::get('createNextIssue', 'SgdzzController@createNextIssue');//@todo 临时
            Route::post('doPay', 'SgdzzController@doPay');
            Route::post('unPay', 'SgdzzController@unPay');
            Route::post('getOpenResult', 'SgdzzController@getIssueOpenResult');
        });

        //一百万的蛋
        Route::group(['namespace' => 'Egg', 'prefix' => 'egg'], function() {
            Route::get('click', 'EggController@click');
            Route::get('rank', 'EggController@rank');
            Route::get('getUserInfo', 'EggController@getUserInfo');
        });

        //猜拳
        Route::group(['namespace' => 'Cq', 'prefix' => 'cq'], function() {
            Route::get('hand', 'CqController@hand');
            Route::get('change', 'CqController@change');
            Route::get('getUserInfo', 'CqController@getUserInfo');
        });

        //欢乐攻城
        Route::group(['namespace' => 'Hlgc', 'prefix' => 'hlgc'], function() {
            Route::get('hand', 'HlgcController@hand');
            Route::get('change', 'HlgcController@change');
            Route::get('getUserInfo', 'HlgcController@getUserInfo');
            Route::get('record', 'HlgcController@record');
        });

        //商城
        Route::group(['namespace' => 'Mall', 'prefix' => 'mall'], function() {
            Route::get('carousel', 'IndexController@carousel');
            Route::get('index', 'IndexController@index');
            Route::get('game', 'IndexController@game');
            Route::get('foot', 'IndexController@foot');
            Route::get('goods/list', 'GoodsController@all');
            Route::get('goods/detail', 'GoodsController@detail');
            Route::get('order/index', 'OrderController@index');
            Route::get('order/detail', 'OrderController@detail');
            Route::get('order/express', 'OrderController@express');
            Route::post('order/update', 'OrderController@update');
            Route::post('goods/exchange', 'PayController@exchange');
        });

        //蚂蚁特工队
        Route::group(['namespace' => 'Ant', 'prefix' => 'ant'], function() {
            Route::get('initData', 'AntController@initData');
            Route::get('getUserInfo', 'AntController@getUserInfo');
            Route::get('joinTeam', 'AntController@joinTeam');
        });

        //聚宝盆
        Route::group(['namespace' => 'Jbp', 'prefix' => 'jbp'], function() {
            Route::get('getUserInfo', 'JbpController@getUserInfo');
            Route::get('getYbStatus', 'JbpController@getYbStatus');
            Route::get('comsumeYb', 'JbpController@comsumeYb');
            Route::get('seizeYb', 'JbpController@seizeYb');
            Route::get('getServerTime', 'JbpController@getServerTime');
            Route::get('getStatus', 'JbpController@getStatus');
            Route::get('getTotal', 'JbpController@getTotal');
        });

        //微信红包
        Route::post('third/wechat/lucky-money/{type?}', 'Third\WechatController@lucky_money');

        //农场大亨
        Route::group(['namespace' => 'Ncdh', 'prefix' => 'ncdh'],function (){
            Route::get("getRunningIssue","NcdhController@getRunningIssue");
            Route::get("createNextIssue","NcdhController@createNextIssue");
            Route::post("doPay","NcdhController@doPay");
            Route::post("unPay","NcdhController@unPay");
            Route::post("getIssueOpenResult","NcdhController@getIssueOpenResult");
        });

    });

    Route::group(['namespace' => 'Page'], function() {
        Route::get('zghpt/hb/page', 'Zghpt\HbController@page');
        Route::get('zghpt/vip/page', 'Zghpt\VipController@page');
        Route::get('hldy/page', 'HldyController@page');
        Route::get('hldy2/page', 'HldyController@page');
        Route::get('egg/page', 'EggController@page');
        Route::get('cq/page', 'CqController@page');
        Route::get('hlgc/page', 'HlgcController@page');
        Route::get('ant/page', 'AntController@page');
        Route::get('ant/notice', 'AntController@notice');
        Route::get('sgdzz/page', 'SgdzzController@page');
        Route::get('jbp/page', 'JbpController@page');

        Route::get('user/center/page', 'UserController@center');
        Route::get('user/fan/page', 'UserController@fan');
        Route::get('user/manage', 'UserController@manage');
        Route::get('user/coupon', 'UserController@coupon');
        Route::get('user/orderlist', 'UserController@orderlist');
        Route::get('user/orderdetail', 'UserController@orderdetail');
        Route::get('user/usercenter', 'UserController@usercenter');
        Route::get('user/fan', 'UserController@fan');
        Route::get('user/qrcode', 'UserController@qrcode');

        //商城
        Route::get('mall', 'MallController@index');
        Route::get('mall/index', 'MallController@index');
        Route::get('mall/detail', 'MallController@detail');
        Route::get('mall/langren', 'MallController@langren');
    });

});

Route::get('/', 'HomeController@index');
